package org.ccay.validator.validators;



/**
 * <!-- START SNIPPET: javadoc -->
 * A Non-Field Level validator that validates based on regular expression supplied.
 * <!-- END SNIPPET: javadoc -->
 * <p/>
 * 
 * <!-- START SNIPPET: parameters -->
 * <ul>
 * 	 <li>expression - the Ognl expression to be evaluated against the stack (Must evaluate to a Boolean)</li>
 * </ul>
 * <!-- END SNIPPET: parameters -->
 *
 * 
 * <pre>
 * <!-- START SNIPPET: example -->
 *     &lt;validators&gt;
 *           &lt;validator type="expression"&gt;
 *              &lt;param name="expression"&gt; .... &lt;/param&gt;
 *              &lt;message&gt;Failed to meet Ognl Expression  .... &lt;/message&gt;
 *           &lt;/validator&gt;
 *     &lt;/validators&gt;
 * <!-- END SNIPPET: example -->
 * </pre>
 *
 * 
 */
// START SNIPPET: global-level-validator
public class ExpressionValidator extends AbstractExpressionValidator {

    /* (non-Javadoc)
     * @see org.ccay.validator.validators.AbstractExpressionValidator#processMessage(java.lang.String, java.lang.Object)
     */
    public void processMessage(String fieldName, Object object){
    	log.debug("Validation failed on expression " + expression + " with validated object "+ object);
    	addActionError(object);
    }

}
